<?php

defined('BASEPATH') or die('forbidden');

class Common_Model Extends Model {

    function _init() {
        //定义判断当前是否为主服务器
        header("Access-Control-Allow-Origin:*");
        //判断用户是否在IP白名单中
        /* $ip=get_ip();
          echo $ip."<br>".$this->config['ip_whitelist']."<br>"; */
        if (!check_ip(get_ip(), $this->config['ip_whitelist'])) {
            echo "<script language='javascript'>alert('" . translate('IS_CHECK') . "');</script>";
            exit;
        }
        //包含模块语言包
        global $lang;
        //自动加载的语言包
        $langarr = array('js', 'menu', 'common');
        $appname = trim(base_url(), '/');
        $langname = isset($this->config['languages'][$appname]) ? $this->config['languages'][$appname] : 'zh_CN';
        array_push($langarr, segment(0, 'index'));
        $langarr = array_unique($langarr);
        foreach ($langarr as $m => $n) {
            $filename = APPPATH . "languages/{$langname}/{$n}.php";
            if (is_file($filename)) {
                include $filename;
                //只有JS包和全局才输出到客户端
                if ($n == 'js') {
                    $this->view->assign("jslang", $lang);
                }
            }
        }
        $this->view->assign("langname", $langname);
        $this->view->assign("user_id", $this->input->get('user_id'));
        $this->view->assign("params", $_GET);
        $view = translate('VIEW');
        $add = translate('ADD');
        $edit = translate('EDIT');
        $del = translate('DEL');
        $detail = translate('DETAIL');
        $itemfirst = array('index' => array('name' => $view), 'add' => array('name' => $add), 'edit' => array('name' => $edit), 'del' => array('name' => $del),);
        $itemsecond = array('index' => $view, 'add' => $add, 'edit' => $edit, 'del' => $del);
        $itemthird=array('index' => $view, 'add' => $add, 'edit' => translate('REPLAY'), 'del' => $del);
        $itemfour = array('index' => $view);
        //权限管理权限树列表
        $permissionarray = array(
        	
            'general' => array(
                'name' => translate('MENU_GENERAL'),
                'item' => array(
                    'main' => array('name' => translate('HOME')),
                    'config' => array('name' => translate('MENU_GENERAL_CONFIG'), 'item' => array('index' => $view, 'edit' => $edit, 'restore' => translate('RESTORE')),),
                    'crontab' => array('name' => translate('MENU_GENERAL_CRONTAB'), 'item' => $itemsecond),
                    'personal' => array('name' => translate('MENU_GENERAL_PERSONAL')),
                    'checkenv' => array('name' => translate('MENU_GENERAL_CHECKENV')),
                    'cache' => array('name' => translate('MENU_GENERAL_CACHE')),
                    'strategy' => array('name' => translate('MENU_GENERAL_STRATEGY'), 'item' => $itemsecond),
                	
                ),
                'append' => array(
                    array('text' => translate('LOGOUT'), 'url' => 'index/logout', 'nopermission' => true, 'target' => '_parent'),
                )
            ),
            
            'role' => array(
                'name' => translate('MENU_ROLE'),
                'item' => array(
                    'role' => array('name' => translate('MENU_ROLE_ROLE'), 'item' => $itemsecond),
                    'admin' => array('name' => translate('MENU_ROLE_ADMIN'), 'item' => $itemsecond),
                    'log' => array('name' => translate('MENU_ROLE_LOG'), 'item' => $itemsecond),
                    'gmsendlog' => array('name' => translate('MENU_GM_SEND_LOG'), 'item' => $itemsecond),
                ),
            ),
            'datastatistics' => array(
                'name' => translate('MENU_DATA'),
                'item' => array(
                    //'datacreate' => array('name' => translate('MENU_DATASTATISTICS_DATACREATE'), 'item' => $itemsecond),
            		//'reportcreate' => array('name' => translate('MENU_DATASTATISTICS_REPORTCREATE'), 'item' => $itemsecond),
            		'servermap' => array('name' => translate('MENU_DATASTATISTICS_SERVERMAP'), 'item' => $itemsecond),
                ),
            ),
            'area' => array(
                'name' => translate('MENU_AREA'),
                'item' => array(
                    'area' => array('name' => translate('MENU_AREA_AREA'), 'item' => $itemsecond),
                    'realtime' => array('name' => translate('MENU_AREA_REALTIME'), 'item' => $itemsecond,),
                    'mergearea' => array('name' => translate('MENU_AREA_MERGE'), 'item' => $itemsecond),
                    //'statistics' => array('name' => translate('MENU_AREA_STATISTICS'), 'item' => $itemsecond,),
                ),
            ),
            'gameitems' => array(
                'name' => translate('MENU_GAME_ITEMS'),
                'item' => array(
                    'gameitems' => array('name' => translate('MENU_VIEW_GAME_ITEM'), 'item' => $itemsecond),
                ),
            ),
            //玩家信息（汇总页面）
            'player_info_detail' => array
            (
                'name' => translate("MENU_PLAYER_DETAIL_INFO"),
                'item' => array
                (
                    'playerdetailinfo' => array('name' => translate('MENU_PLAYER_DETAIL_INFO_PAGE'), 'item' => $itemsecond),

                ),
            ),
            'channel' => array
            (
                'name' => translate("MENU_APP_CHANNEL_MANAGE"),
                'item' => array
                (
                    'channelmgr' => array('name' => translate('MENU_GENERAL_CHANNEL'), 'item' => $itemsecond),
                ),
            ),
            //add by dragon.hu @2015.12.2游戏激活码模块
            'cdkey' => array(
                'name' => translate('MENU_CDKEY'),
                'item' => array(
                    'cdkeygiftbag' => array('name' => translate('MENU_CDKEY_GIFTBAG'), 'item' => $itemsecond),
                    //'cdkeytype' => array('name' => translate('MENU_CDKEY_TYPE'), 'item' => $itemsecond),
                    'cdkeycreate' => array('name' => translate('MENU_CDKEY_CREATE'), 'item' => $itemsecond),
                    'cdkeyview' => array('name' => translate('MENU_CDKEY_VIEW'), 'item' => $itemsecond),
                    //'cdkeymanager' => array('name' => translate('MENU_CDKEY_MANAGER'), 'item' => $itemsecond),
                ),
            ),
            'notice' => array(
                'name' => translate('MENU_NOTICE'),
                'item' => array(
                    //'noticemamage' => array('name' => translate('MENU_NOTICE_NOTICEMAMAGE'), 'item' => $itemsecond),
                    'newnoticemanager' => array('name' => translate('MENU_NOTICE_NEWMANAGER'), 'item' => $itemsecond)
                ),
            ),
            'seal' => array(
                'name' => translate('MENU_SEAL'),
                'item' => array(
                    'simulaterecharge' => array('name' => translate('MENU_SIMULATE_RECHARGE'), 'item' => $itemsecond),
                    'simulaterecharge_log' => array('name' => translate('MENU_SIMULATE_RECHARGE_LOG'), 'item' => $itemsecond),
                    'sendmail_log' => array('name' => translate('MENU_SEND_MAIL_LOG'), 'item' => $itemsecond),
                    'sendmail' => array('name' => translate('MENU_SEND_MAIL'), 'item' => $itemsecond),
                     'registmail_log' => array('name' => translate('MENU_REGIST_MAIL_LOG'), 'item' => $itemsecond),
                    //'registmail' => array('name' => translate('MENU_REGIST_MAIL'), 'item' => $itemsecond),
                    'sealaccountlist' => array('name' => translate('MENU_SEAL_SEALACCOUNTLIST'), 'item' => $itemsecond),

                    //'sealchat' => array('name' => translate('MENU_SEAL_SEALCHAT'), 'item' => $itemsecond),
                    'blacklist' => array('name' => translate('MENU_SEAL_BLACKLIST'), 'item' => $itemsecond),
                    //'kickoffplayer' => array('name' => translate('MENU_SEAL_KICKOFFPLAYER'), 'item' => $itemsecond),
                    //'passwordreset' => array('name' => translate('MENU_SEAL_PASSWORDRESET')),
                    //'flashmove' => array('name' => translate('MENU_SEAL_FLASHMOVE'), 'item' => $itemsecond),
                    //'pvpbusiness' => array('name' => translate('MENU_SEAL_PVPBUSINESS'), 'item' => $itemsecond),
                    //'gmcommand' => array('name' => translate('MENU_SEAL_GMCOMMAND'), 'item' => $itemsecond),
                    //'returnequipment' => array('name' => translate('MENU_SEAL_RETURNEQUIPMENT'), 'item' => $itemsecond),
                    'pullrolelevel'=>  array('name' => translate('MENU_SEAL_PULLROLELEVEL'), 'item' => $itemsecond),
                    //'multiexcelseal'=>array('name'=>  translate('MENU_SEAL_MULTIEXCELSEAL'),'item'=>$itemsecond),
                	'delplayerobject'=>array('name'=>  translate('MENU_DEL_OBJECT'),'item'=>$itemsecond),  
                	//'resupplyorder'=>array('name' => translate('MENU_SEAL_RESUPPLYORDER'), 'item' => $itemsecond),
                	//'resupplycporder'=>array('name' => translate('MENU_SEAL_RESUPPLYCPORDER'), 'item' => $itemsecond),
                	'reloadtables'=>array('name' => translate('MENU_SEAL_RELOADTALBES'), 'item' => $itemsecond),
                    'feedback' => array('name' => translate('MENU_PLAYER_FEEDBACK'), 'item' => $itemsecond),
                    'feedbackreplay' => array('name' => translate('MENU_FEEDBACK_REPLAY'), 'item' => $itemfour),
                    'setgm' => array('name' => translate('MENU_SET_PLAYER_GM_STATE'), 'item' => $itemfour),
                    'showgm' => array('name' => translate('MENU_SHOW_ALL_PLAYER_GM'), 'item' => $itemfour),
                	//'rolerestore'=>array('name' => translate('MENU_SEAL_ROLERESTORE'), 'item' => $itemsecond),
                    //'modifysystime' => array('name' => translate('MENU_SEAL_MODIFY_SYSTEM_DATETIME'), 'item' => $itemsecond),
                ),
            ),
            //LOG货币及物品信息
            'log_object' => array
            (
                'name' => translate("MENU_ABOUT_OBJECT"),
                'item' => array
                (
                    'diamond'=>array('name'=>translate('MENU_ABOUT_OBJECT_DIAMOND'), 'item' => $itemfour),
                    'goldcoin'=>array('name'=>translate('MENU_ABOUT_OBJECT_GOLDCOIN'), 'item' => $itemfour),
                    'sangokumsoumoney'=>array('name'=>translate('MENU_ABOUT_OBJECT_SGKM_MONEY'), 'item' => $itemfour),
                    'tiredrecord'=>array('name'=>translate('MENU_ABOUT_OBJECT_TIREDRECORD'), 'item' => $itemfour),
                    'hero'=>array('name'=>translate('MENU_ABOUT_OBJECT_HERO'), 'item' => $itemfour),
                    'heropiece'=>array('name'=>translate('MENU_ABOUT_OBJECT_HEROPIECE'), 'item' => $itemfour),
                    'gameitem'=>array('name'=>translate('MENU_ABOUT_OBJECT_ITEM'), 'item' => $itemfour),
                    'equip'=>array('name'=>translate('MENU_ABOUT_OBJECT_EQUIP'), 'item' => $itemfour),
                    'equippiece'=>array('name'=>translate('MENU_ABOUT_OBJECT_EQUIP_PIECE'), 'item'=>$itemfour),
                    'gem'=>array('name'=>translate('MENU_ABOUT_OBJECT_GEM'), 'item' => $itemfour),
                    'gempiece'=>array('name'=>translate('MENU_ABOUT_OBJECT_GEMPIECE'), 'item' => $itemfour),
                    'fashion'=>array('name'=>translate('MENU_ABOUT_OBJECT_FASHION'), 'item' => $itemfour),
                    'fashionpiece'=>array('name'=>translate('MENU_ABOUT_OBJECT_FASHIONPIECE'), 'item' => $itemfour),
                    'weak'=>array('name'=>translate('MENU_ABOUT_OBJECT_WEAK'), 'item' => $itemfour),
                ),
            ),
            //LOG货币及物品信息
            'log_chat' => array
            (
                'name' => translate("MENU_CHAT_LOG"),
                'item' => array
                (
                    'chat'=>array('name'=>translate('MENU_ABOUT_CHAT_LOG'), 'item' => $itemfour),
                ),
            ),
            'activity' => array(
                'name' => translate('MENU_ACTIVITY'),
                'item' => array(
                	//'actmultiopen' => array('name' => translate('MENU_ACTIVITY_MULTIOPEN'), 'item' => $itemsecond),
                    'activitytime' => array('name' => translate('MENU_ACTIVITY_ACTIVITYTIME'), 'item' => $itemsecond),
            		'activityedit' => array('name' => translate('MENU_ACTIVITY_ACTIVITYEDIT'), 'item' => $itemsecond),
                	'giftbagtime' => array('name' => translate('MENU_ACTIVITY_GIFTBAGTIME'), 'item' => $itemsecond),
                	'gamegiftbag' => array('name' => translate('MENU_ACTIVITY_GMGIFTBAG'), 'item' => $itemsecond),
                    'giftbag' => array('name' => translate('MENU_ACTIVITY_GIFTBAG'), 'item' => $itemsecond),
            		//'group' => array('name' => translate('MENU_ACTIVITY_GROUP'), 'item' => $itemsecond),
            		//'grouparea' => array('name' => translate('MENU_ACTIVITY_GROUPAREA'), 'item' => $itemsecond),
            		//'groupstrategy' => array('name' => translate('MENU_ACTIVITY_GROUPSTRATEGY'), 'item' => $itemsecond),
            		//'module' => array('name' => translate('MENU_ACTIVITY_MODULE'), 'item' => $itemsecond),
            		//'moduledetail' => array('name' => translate('MENU_ACTIVITY_MODULEDETAIL'), 'item' => $itemsecond),
            		//'modulecopy' => array('name' => translate('MENU_ACTIVITY_MODULECOPY'), 'item' => $itemsecond),
            		//'strategy' => array('name' => translate('MENU_ACTIVITY_STRATEGY'), 'item' => $itemsecond),
            		//add by dragon.hu@2015.12.1  激活码管理--新加到激活码模块中了，这个不要了
            		//'cdkeymanager' => array('name' => translate('MENU_ACTIVITY_CDKEY'), 'item' => $itemsecond),
                	//dragon.hu add @2015.12.9 折扣商店
                	'discountshop' => array('name' => translate('MENU_MALL_DISCOUNTSHOP'),'item' => $itemsecond),
                	//dragon.hu add @2015.12.11刷刷乐
                	'sevenbrush' => array('name' => translate('MENU_MALL_SEVENBRUSH'),'item' => $itemsecond),
                	//dragon.hu add @2016.1.9七天狂欢
                	'sevencarnival' => array('name' => translate('MENU_MALL_SEVENCARNIVAL'),'item' => $itemsecond),
                	//dragon.hu add @2016.5.9活动广告
                	'activityad' => array('name' => translate('MENU_ACTIVITY_AD'),'item' => $itemsecond),
                	),
            	),
        		
        		//dragon.hu add @2015.12.9 折扣商店
        		/*'mall' => array(
        				'name' => translate('MENU_MALL'),
        				'item' => array(
        						//'mallclassification' => array('name' => translate('MENU_MALL_MALLCLASSIFICATION'), 'item' => $itemsecond),
        						//'storegoods' => array('name' => translate('MENU_MALL_STOREGOODS'), 'item' => $itemsecond),
        						//'treasureboxratio'=>array('name' => translate('MENU_MALL_TREASUREBOXRATIO'),'item' => $itemsecond),
        						'discountshop'=>array('name' => translate('MENU_MALL_DISCOUNTSHOP'),'item' => $itemsecond),
        				)
        		),*/
        		

        		
        		//add by dragon.hu @2015.12.21游戏运营相关数据分析
        		'businessdata' => array(
        				'name' => translate('MENU_BUSINESSDATA'),
        				'item' => array(
        						'businesschargedata' => array('name' => translate('MENU_BUSINESSDATA_CHARGEDATA'), 'item' => $itemsecond),
        						'businessmanager' => array('name' => translate('MENU_BUSINESSDATA_MANAGER'), 'item' => $itemsecond),
        						'businessmanagerrole' => array('name' => translate('MENU_BUSINESSDATA_MANAGERROLE'), 'item' => $itemsecond),
        						'businessmanagerall' => array('name' => translate('MENU_BUSINESSDATA_MANAGERALL'), 'item' => $itemsecond),
        						//'businessmanagerroleall' => array('name' => translate('MENU_BUSINESSDATA_MANAGERROLEALL'), 'item' => $itemsecond),
        						'businessrecord' => array('name' => translate('MENU_BUSINESSDATA_RECORD'), 'item' => $itemsecond),
        						'presentdiamond' => array('name' => translate('MENU_BUSINESSDATA_PRESENTDIAMOND'), 'item' => $itemsecond),
        				),
        		),
        		//add by dragon.hu @2016.3.1游戏数据分析
        		'gamedata' => array(
        				'name' => translate('MENU_GAMEDATA'),
        				'item' => array(
        						'moneystatistics' => array('name' => translate('MENU_GAMEDATA_MONEYSTATISTICS'), 'item' => $itemsecond),
        						'vipstatistics' => array('name' => translate('MENU_GAMEDATA_VIPSTATISTICS'), 'item' => $itemsecond),
        						/*'levelstatistics' => array('name' => translate('MENU_GAMEDATA_LEVELSTATISTICS'), 'item' => $itemsecond),
        						'buystatistics' => array('name' => translate('MENU_GAMEDATA_BUYSTATISTICS'), 'item' => $itemsecond),
        						'activitystatistics' => array('name' => translate('MENU_GAMEDATA_ACTIVITYBUYSTATISTICS'), 'item' => $itemsecond),
        						'guidestatistics' => array('name' => translate('MENU_GAMEDATA_GUIDESTATISTICS'), 'item' => $itemsecond),
        						'taskstatistics' => array('name' => translate('MENU_GAMEDATA_TASKSTATISTICS'), 'item' => $itemsecond),
        						'copystatistics' => array('name' => translate('MENU_GAMEDATA_COPYSTATISTICS'), 'item' => $itemsecond),
        						'timelengthstatistics' => array('name' => translate('MENU_GAMEDATA_TIMELENGTHSTATISTICS'), 'item' => $itemsecond),
        						'toponlinestatistics' => array('name' => translate('MENU_GAMEDATA_TOPONLINESTATISTICS'), 'item' => $itemsecond),
        						'storediamondstatistics' => array('name' => translate('MENU_GAMEDATA_STOREDIAMOND'), 'item' => $itemsecond),*/
        				),
        		),
        		//add by dragon.hu @2016.3.16游戏数据分析
            /**
             * 数据日报
             */
//        		'datareport' => array(
//        				'name' => translate('MENU_DATAREPORT'),
//        				'item' => array(
//        						'reportcharge' => array('name' => translate('MENU_DATAREPORT_CHARGE'), 'item' => $itemsecond),
//        						'reportchargeaccount' => array('name' => translate('MENU_DATAREPORT_CHARGEACCOUNT'), 'item' => $itemsecond),
//        						'reportbusiness' => array('name' => translate('MENU_DATAREPORT_BUSINESS'), 'item' => $itemsecond),
//        						'reportbusinessaccount' => array('name' => translate('MENU_DATAREPORT_BUSINESSACCOUNT'), 'item' => $itemsecond),
//        						'reportother' => array('name' => translate('MENU_DATAREPORT_OTHER'), 'item' => $itemsecond),
//        				),
//        		),
            /*	
            'freegift' => array(
                'name' => translate('MENU_REWARD'),
                'item' => array(
                    'cdkey' => array('name' => translate('MENU_REWARD_CDKEY'), 'item' => $itemsecond),
                    'cdkeytype' => array('name' => translate('MENU_REWARD_CDKEY_TYPE'), 'item' => $itemsecond),
                    'excelmulti'=>array('name'=>  translate('MENU_FREEGIFT_EXCELMULTI'),'item'=>$itemsecond),            
                ),
            ),*/
           // 'mail' => array( //在GM操作里面发邮件
           //     'name' => translate('MENU_MAIL'),
           //     'item' => array(
           //         'singlemail' => array('name' => translate('MENU_MAIL_SINGLEMAIL'), 'item' => $itemsecond),
           //         'groupmail' => array('name' => translate('MENU_MAIL_GROUPMAIL'), 'item' => $itemsecond),
           // 		//'excelfile' => array('name' => translate('MENU_MAIL_EXCELFILE'), 'item' => $itemsecond),
           // 		//'sendlog' => array('name' => translate('MENU_MAIL_SENDLOG'), 'item' => $itemsecond),
           //     ),
           // ),
            //'broadcast' => array(
            //    'name' => translate('MENU_BROADCAST'),
            //    'item' => array(
            //        'broadcastmamage' => array('name' => translate('MENU_BROADCAST_BROADCASTMAMAGE'), 'item' => $itemsecond)
            //    ),
            //),

            
             //$itemthird= array('edit' => translate('REPLAY'), 'del' => $del);
             /*
             'buglist' => array(
                'name' => translate('MENU_BUGLIST'),
                'item' => array(
                    //'playerbug' => array('name' => translate('MENU_BUGLIST_PLAYERBUG')),
                    //'managerbug' => array('name' => translate('MENU_BUGLIST_MANAGERBUG'), 'item' => $itemthird),
            		//'managerpkg' => array('name' => translate('MENU_BUGLIST_MANAGERPKG'), 'item' => $itemthird),
            		'GMhelper' => array('name' => translate('MENU_GMHELPER'), 'item' => $itemsecond),
                ),
            ),*/

            /***
             * 统计信息
             */
//            'message' => array(
//                'name' => translate('MENU_MESSAGEQUERY'),
//                'item' => array(
//                    //'maildata' => array('name' => translate('MENU_MESSAGE_MAILDATA'), 'item' => $itemsecond),
//            		//'mailitem' => array('name' => translate('MENU_MESSAGE_MAILITEM'), 'item' => $itemsecond),
//
//            		//'jifenqiang' => array('name' => translate('MENU_PLAYERLOG_JIFENQIANG'), 'item' => $itemfour),
//            		//'crashreport' => array('name' => translate('MENU_MESSAGE_CRASHREPORT'), 'item' => $itemsecond),
//            		//'fenxiReport' => array('name' => translate('MENU_MESSAGE_FENXIREPORT'), 'item' => $itemsecond),
//            		//'fenxiReportgraph' => array('name' => translate('MENU_MESSAGE_FENXIREPORTGRAPH'), 'item' => $itemsecond),
//                	//'dataAnalysis' => array('name' => translate('MENY_MESSAGE_DATAANALYSIS'), 'item' => $itemsecond),
//                	//'fbdataAnalysis' => array('name' => translate('MENU_MESSAGE_FBDATA'), 'item' => $itemsecond),
//                	//'roledataAnalysis' => array('name' => translate('MENU_MESSAGE_ROLEDATA'), 'item' => $itemsecond),
//                	//'serverdataAnalysis' => array('name' => translate('MENU_MESSAGE_SERVERDATA'), 'item' => $itemsecond),
//
//                	'servergolddata' => array('name' => translate('MENU_MESSAGE_SERVEREGOLDDATA'), 'item' => $itemsecond),
//                	'serversmeltdata' => array('name' => translate('MENU_MESSAGE_SERVERSMELTDATA'), 'item' => $itemsecond),
//                	'orangeequipexpense' => array('name' => translate('MENU_MESSAGE_SERVERORANGEEQUIP'), 'item' => $itemsecond),
//                	'threestarpet' => array('name' => translate('MENU_MESSAGE_SERVERTHREEPET'), 'item' => $itemsecond),
//                	'gemoutput' => array('name' => translate('MENU_MESSAGE_SERVERGEMDATA'), 'item' => $itemsecond),
//                	'serverequipdata' => array('name' => translate('MENU_MESSAGE_SERVEREQUIPDATA'), 'item' => $itemsecond),
//                ),
//            ),

            //推送
            /*
            'push' => array
            (
            		'name' => translate("MENU_PUSH"),
            		'item' => array
            		(
            				'push_role'=>array('name'=>translate('MENU_PUSH_ROLE'), 'item' => $itemfour),
            				'push_server'=>array('name'=>translate('MENU_PUSH_SERVER'), 'item' => $itemfour),
            				'push_channel'=>array('name'=>translate('MENU_PUSH_CHANNEL'), 'item' => $itemfour),
            				'push_excel'=>array('name'=>translate('MENU_PUSH_EXCEL'), 'item' => $itemfour),
            				'roletoken'=>array('name'=>translate('MENU_PUSH_ROLETOKEN'), 'item' => $itemfour),
            				'sendlog'=>array('name'=>translate('MENU_PUSH_LOG'), 'item' => $itemfour),
            		),
            ),
            */
            //上传
            'tmpupload' => array
            (
                'name' => translate("MENU_UPLOAD"),
                'item' => array
                (
                    'tmpuploadfile' => array('name' => translate('MENU_UPLOAD_FILE'), 'item' => $itemfour),
                ),
            ),
        		
        		//游戏日志下载
        		'download_log' => array
        		(
        				'name' => translate("MENU_DOWNLOAD_LOG"),
        				'item' => array
        				(
        						'downloadlogdata'=>array('name'=>translate('MENU_DOWNLOAD_LOG_DATA'), 'item' => $itemfour),
        				),
        		),
            	//玩家基本信息
            	'dbplayer' => array
            	(
            		'name' => translate("MENU_DBPLAYER"),
            		'item' => array
            			(
            				'account' => array('name' => translate('MENU_MESSAGE_ACCOUNT'), 'item' => $itemfour),
            				'attribute' => array('name' => translate('MENU_MESSAGE_ATTRIBUTE'), 'item' => $itemfour),
            				//'skillhotkey' => array('name' => translate('MENU_DBPLAYER_SKILLHOTKEY'), 'item' => $itemfour),
            				//'vip' => array('name' => translate('MENU_DBPLAYER_VIP'), 'item' => $itemfour),
                    		//'petnew' => array('name' => translate('MENU_DBPLAYER_PET'), 'item' => $itemfour),
            				//'append' => array('name' => translate('MENU_DBPLAYER_APPEND'), 'item' => $itemfour),
                            //'title' => array('name' => translate('MENU_DBPLAYER_TITLE'), 'item' => $itemfour),
                            //'task' => array('name' => translate('MENU_MESSAGE_TASK'), 'item' => $itemfour),
                            //'playerinfo' => array('name' => translate('MENU_MESSAGE_PLAYERINFO'), 'item' => $itemfour),
                            //'skill' => array('name' => translate('MENU_MESSAGE_SKILL'), 'item' => $itemfour),
            			),
            	),
                //关卡
                'playercopy' => array
                (
                    'name' => translate("MENU_PLAYER_COPY_INFO"),
                    'item' => array
                        (
                            'maincopy' => array('name' => translate('MENU_PLAYER_COPY_MAIN'), 'item' => $itemfour),
                            'elitecopy' => array('name' => translate('MENU_PLAYER_COPY_ELITE'), 'item' => $itemfour),
                            'famouscopy' => array('name' => translate('MENU_PLAYER_COPY_FAMOUS'), 'item' => $itemfour),
                            'dailycopy' => array('name' => translate('MENU_PLAYER_COPY_DAILY'), 'item' => $itemfour),
                        ),
                ),
            	//关卡
            	//'dbequipment' => array
            	//(
            	//	'name' => translate("MENU_DBPROPERTY"),
            	//	'item' => array
            	//		(
            	//			'equipforge' => array('name' => translate('MENU_DBEQUIPMENT_EQUIPFORGE'), 'item' => $itemfour),
                //            'equipaddinfo' => array('name' => translate('MENU_MESSAGE_EQUIPADDINFO'), 'item' => $itemfour),
            	//			'equipupgrade' => array('name' => translate('MENU_MESSAGE_EQUIPUPGRADE'), 'item' => $itemfour),
            	//			'equipseal' => array('name' => translate('MENU_MESSAGE_EQUIPSEAL'), 'item' => $itemfour),
            	//			//'bless' => array('name' => translate('MENU_MESSAGE_BLESS'), 'item' =>  $itemfour),
            	//		),
            	//),
            	//物品信息
            	//'dbbag' => array
            	//(
            	//	'name' => translate("MENU_DBBAG"),
            	//	'item' => array
            	//		(
            	//			'bag' => array('name' => translate('MENU_MESSAGE_BAG'), 'item' => $itemfour),
            				//'packagesetting' => array('name' => translate('MENU_MESSAGE_PACKAGESETTING'), 'item' => $itemfour),
            	//		),
            	//),
            	//奖励
            	/*
            	'dbreward' => array
            	(
            		'name' => translate("MENU_DBREWARD"),
            		'item' => array
            			(
            				'reward'=>array('name'=>translate('MENU_DBREWARD_REWARD'), 'item' => $itemfour),            				
            			),
            	),
            	*/
            	//公会
            	'dbgang' => array
            	(
            		'name' => translate("MENU_DBGANG"),
            		'item' => array
            			(
            				'gang'=>array('name'=>translate('MENU_DBGANG_GANG'), 'item' => $itemfour),
            				//'gangactive'=>array('name'=>translate('MENU_DBGANG_GANGACTIVE'), 'item' => $itemfour),
            				//'gangapply'=>array('name'=>translate('MENU_DBGANG_GANGAPPLY'), 'item' => $itemfour),
            				//'gangbadge'=>array('name'=>translate('MENU_DBGANG_GANGBADGE'), 'item' => $itemfour),
            				'gangexittime'=>array('name'=>translate('MENU_DBGANG_GANGEXITTIME'), 'item' => $itemfour),
            				//'gangfight'=>array('name'=>translate('MENU_DBGANG_GANGFIGHT'), 'item' => $itemfour),
            				//'gangfightplayer'=>array('name'=>translate('MENU_DBGANG_GANGPLAYER'), 'item' => $itemfour),
            				//'ganginvite'=>array('name'=>translate('MENU_DBGANG_GANGINVITE'), 'item' => $itemfour),
            				'ganglog'=>array('name'=>translate('MENU_DBGANG_GANGLOG'), 'item' => $itemfour),
            				'gangrole'=>array('name'=>translate('MENU_DBGANG_GANGROLE'), 'item' => $itemfour),
            				//'gangskill'=>array('name'=>translate('MENU_DBGANG_GANGSKILL'), 'item' => $itemfour),
            			),
            	),
            	//充值
            	'dbvip' => array
            	(
            		'name' => translate("MENU_DBVIP"),
            		'item' => array
            			(
            				//因需要补发订单，在此要用itemsecond
            				'payment' => array('name' => translate('MENU_MESSAGE_PAYMENT'), 'item' => $itemthird),
            				//'dbpayment' => array('name' => translate('MENU_DBVIP_DBPAYMENT'), 'item' => $itemfour),
            				//'totalpayment' => array('name' => translate('MENU_MESSAGE_TOTALPAYMENT'), 'item' => $itemfour),            				
            				//'vip' => array('name' => translate('MENU_MESSAGE_VIP'), 'item' => $itemfour),
            				//'vipvendor' => array('name' => translate('MENU_DBVIP_VENDOR'), 'item' => $itemfour),
            				//'recharge' => array('name' => translate('MENU_DBVIP_RECHARGE'), 'item' => $itemfour),
            			),
            	),
            	//mail
            	'dbmail' => array
            	(
            		'name' => translate("MENU_DBMAIL"),
            		'item' => array
            			(
            				'mail' => array('name' => translate('MENU_DBMAIL_MAIL'), 'item' => $itemfour),
            				'maildata' => array('name' => translate('MENU_DBMAIL_MAILDATA'), 'item' => $itemfour),
            				'mailitem' => array('name' => translate('MENU_DBMAIL_MAILITEM'), 'item' => $itemfour),
            			),
            	),
                'dbgmsenditems' => array
                (
                    'name' => translate("MENU_DBGM_SEND_ITEMS"),
                    'item' => array
                        (
                            'senditems' => array('name' => translate('MENU_DBGM_SEND_ITEMS_STATISTIC'), 'item' => $itemfour),
                        ),
                ),
            	//交易信息
            	/*
            	'dbtrade' => array
            	(
            			'name' => translate("MENU_DBTRADE"),
            			'item' => array
            			(
            					'auctionitem' => array('name' => translate('MENU_DBTRADE_AUCTIONITEM'), 'item' => $itemfour),
            					'auctionstatistics' => array('name' => translate('MENU_DBTRADE_AUCTIONSTORAGEINFO'), 'item' => $itemfour),
            			),
            	),
            	//其它信息
            	'dbother' => array
            	(
            		'name' => translate("MENU_DBOTHER"),
            		'item' => array
            			(
            				'copycondition'=>array('name'=>translate('MENU_DBOTHER_COPYCONDITION'), 'item' => $itemfour),
            			),
            	),
				*/
        	/*
            //角色基本信息	
            'logrole' => array
            	(
            		'name' => translate("MENU_LOGROLE"),
            		'item' => array
            			(
            				'accountlogin' => array('name' => translate('MENU_PLAYERLOG_ACCOUNTLOG'), 'item' => $itemfour),
                    		'rolelogin' => array('name' => translate('MENU_PLAYERLOG_ROLELOG'), 'item' => $itemfour),
                    		//'clientdownload' => array('name' => translate('MENU_LOGPROPERTY_CLIENTDOWNLOAD'), 'item' => $itemfour),
                    		//'accountcreate' => array('name' => translate('MENU_LOGPROPERTY_ACCOUNTCREATE'), 'item' => $itemfour),
                    		'rolecreate' => array('name' => translate('MENU_LOGPROPERTY_ROLECREATE'), 'item' => $itemfour),
                    		'roledelete' => array('name' => translate('MENU_LOGPROPERTY_ROLEDELETE'), 'item' => $itemfour),
            			),
            	),
            
			//属性体系信息	
            'logproperty' => array
            	(
            		'name' => translate("MENU_LOGPROPERTY"),
            		'item' => array
            			(
            				'equipforge'=> array('name' => translate('MENU_PLAYERLOG_EQUIPFORGE'),'item' => $itemfour),   
            				//'mastermind'=> array('name' => translate('MENU_LOGPROPERTY_MASTERMIND'),'item' => $itemfour), 
            				//'mastermindgetexp'=> array('name' => translate('MENU_LOGPROPERTY_MASTERMINDGETEXP'),'item' => $itemfour), 
            				//'unlockguerrilla'=> array('name' => translate('MENU_LOGPROPERTY_UNLOCKGUERRILLA'),'item' => $itemfour), 
            				//'propertyintensify'=> array('name' => translate('MENU_LOGPROPERTY_PROPERTYINTENSIFY'),'item' => $itemfour), 
            				//'propertyaccelerate'=> array('name' => translate('MENU_LOGPROPERTY_PROPERTYACCELERATE'),'item' => $itemfour),
            			),
            	),
        		//宠物体系信息
        		'logaboutpet' => array
        		(
        				'name' => translate("MENU_LOGABOUTPET"),
        				'item' => array
        				(
        						''=> array('name' => translate(''),'item' => $itemfour),
        						''=> array('name' => translate(''),'item' => $itemfour),
        				),
        		),
            	//货币体系信息	
            	'logmonetary' => array
            	(
            		'name' => translate("MENU_LOGMONETARY"),
            		'item' => array
            			(
            				'honorpointproduce' => array('name' => translate('MENU_PLAYERLOG_HONORPOINTPRODUCE'), 'item' => $itemfour),
            				'honorpointincome' => array('name' => translate('MENU_PLAYERLOG_HONORPOINTINCOME'), 'item' => $itemfour),
            				'goldproduce' => array('name' => translate('MENU_PLAYERLOG_GOLDPRODUCE'), 'item' => $itemfour),
                    		'goldincome' => array('name' => translate('MENU_PLAYERLOG_GOLDINCOME'), 'item' => $itemfour),
            				//'pointproduce' => array('name' => translate('MENU_PLAYERLOG_POINTPRODUCE'), 'item' => $itemfour),
                    		//'pointincome' => array('name' => translate('MENU_PLAYERLOG_POINTINCOME'), 'item' => $itemfour),
            				'silverproduce' => array('name' => translate('MENU_PLAYERLOG_SILVERPRODUCE'), 'item' => $itemfour),
                    		'silverincome' => array('name' => translate('MENU_PLAYERLOG_SILVERINCOME'), 'item' => $itemfour),
            				
            				'smeltproduce' => array('name' => translate('MENU_PLAYERLOG_SMELTPRODUCE'), 'item' => $itemfour),//
            				'smeltincome' => array('name' => translate('MENU_PLAYERLOG_SMELTINCOME'), 'item' => $itemfour),//
            					
            				'expproduce' => array('name' => translate('MENU_PLAYERLOG_EXPPRODUCE'), 'item' => $itemfour),
            					
            				'glory' => array('name' => translate('MENU_PLAYERLOG_GLORY'), 'item' => $itemfour),//
            				//'fatiguebuy' => array('name' => translate('MENU_PLAYERLOG_FATIGUEBUY'), 'item' => $itemfour), 
            				'tiredrecord' => array('name' => translate('MENU_PLAYERLOG_TIRED'), 'item' => $itemfour),
            					
            				'exvvalue' => array('name' => translate('MENU_PLAYERLOG_EXVVALUE'), 'item' => $itemfour),//
            			),
            	),
            	
            	//技能体系信息	
            	'logskill' => array
            	(
            		'name' => translate("MENU_LOGSKILL"),
            		'item' => array
            			(
            				'activeskill'=>array('name'=>translate('MENU_LOGSKILL_ACTIVESKILL'), 'item' => $itemfour),   
            				'roleupgrade'=>array('name'=>translate('MENU_LOGSKILL_ROLEUPGRADE'), 'item' => $itemfour),   
            				         				
            			),
            	),
            	//物品体系信息
            	'logobject' => array
            	(
            		'name' => translate("MENU_LOGOBJECT"),
            		'item' => array
            			(
            				'objectproduce' => array('name' => translate('MENU_PLAYERLOG_OBJECTPRODUCE'), 'item' => $itemfour),
            				'useobject' => array('name' => translate('MENU_PLAYERLOG_USEOBJECT'), 'item' => $itemfour), 
            			),
            	),
            	
            	//战斗体系信息
            	'logbattle' => array
            	(
            		'name' => translate("MENU_LOGFIGHT"),
            		'item' => array
            			(            				
            				'arena'=>array('name'=>translate('MENU_LOGFIGHT_ARENA'), 'item' => $itemfour),   
            				'dueltop'=>array('name'=>translate('MENU_LOGFIGHT_DUELTOP'), 'item' => $itemfour),
            				//'abattoir'=>array('name'=>translate('MENU_LOGFIGHT_ABATTOIR'), 'item' => $itemfour),
            				//'threevthree'=>array('name'=>translate('MENU_LOGFIGHT_3V3'), 'item' => $itemfour),
            				//'deathtower'=>array('name'=>translate('MENU_LOGFIGHT_DEATHTOWER'), 'item' => $itemfour),
            				'bosscopy'=>array('name'=>translate('MENU_LOGFIGHT_BOSSCOPY'), 'item' => $itemfour),
            				'guardlafuer'=>array('name'=>translate('MENU_LOGFIGHT_GUARDLAFUER'), 'item' => $itemfour),
            				'copy'=>array('name'=>translate('MENU_LOGFIGHT_COPY'), 'item' => $itemfour),
            				'elitecopy'=>array('name'=>translate('MENU_LOGFIGHT_ELITECOPY'), 'item' => $itemfour),
            				//'devilcopy'=>array('name'=>translate('MENU_LOGFIGHT_DEVILCOPY'), 'item' => $itemfour),
            				//'deathmonsters'=>array('name'=>translate('MENU_LOGFIGHT_DEATHMONSTERS'), 'item' => $itemfour),
            				//'deathplayer'=>array('name'=>translate('MENU_LOGFIGHT_DEATHPLAYER'), 'item' => $itemfour),
            				'goldcopy'=>array('name'=>translate('MENU_LOGFIGHT_GOLDCOPY'), 'item'=> $itemfour),
            				'lifecopy'=>array('name'=>translate('MENU_LOGFIGHT_LIFECOPY'), 'item'=> $itemfour),
            				'relicssecret'=>array('name'=>translate('MENU_LOGFIGHT_RELICSSECRET'), 'item'=> $itemfour),
            				'team'=>array('name'=>translate('MENU_LOGFIGHT_TEAM'), 'item'=> $itemfour),
            				'chess'=>array('name'=>translate('MENU_LOGFIGHT_CHESS'), 'item'=> $itemfour),
            				'element'=>array('name'=>translate('MENU_LOGFIGHT_ELEMENT'), 'item'=> $itemfour),
            				'poley'=>array('name'=>translate('MENU_LOGFIGHT_POLEY'), 'item'=> $itemfour),
            				'gangfight'=>array('name'=>translate('MENU_LOGFIGHT_GANGFIGHT'), 'item'=> $itemfour),
            			),
            	),
            	
            	//社交类信息
            	'logsociality' => array
            	(
            		'name' => translate("MENU_LOGSOCIALITY"),
            		'item' => array
            			(
            				//'activeskill'=>array('name'=>translate('MENU_SKILLSYSTEM_ACTIVESKILL'), 'item' => $itemfour),
            				//'resetskill'=>array('name'=>translate('MENU_SKILLSYSTEM_RESETSKILL'), 'item' => $itemfour),
            				//'upgradegangskill'=>array('name'=>translate('MENU_SKILLSYSTEM_UPGRADEGANGSKILL'), 'item' => $itemfour),
            			),
            	),
            	//帮派类信息
            	'loggang' => array
            	(
            		'name' => translate("MENU_LOGGANG"),
            		'item' => array
            			(
            				'rolegang'=>array('name'=>translate('MENU_LOGGANG_ROLEGANG'), 'item' => $itemfour),
            				'upgradegang'=>array('name'=>translate('MENU_LOGGANG_UPGRADEGANG'), 'item' => $itemfour),
            				'rolegangexit'=>array('name'=>translate('MENU_LOGGANG_ROLEGANGEXIT'), 'item' => $itemfour),
            				'gangestablish'=>array('name'=>translate('MENU_LOGGANG_GANGESTABLISH'), 'item' => $itemfour),
            				'rolegangposition'=>array('name'=>translate('MENU_LOGGANG_ROLEGANGPOSITION'), 'item' => $itemfour),
            				'gangdissolve'=>array('name'=>translate('MENU_LOGGANG_GANGDISSOLVE'), 'item' => $itemfour),
            				//'gangdonation'=>array('name'=>translate('MENU_LOGGANG_GANGDONATION'), 'item' => $itemfour),
            				'gangbuild'=>array('name'=>translate('MENU_LOGGANG_GANGBUILD'), 'item'=>$itemfour),
            				'ganggetexp'=>array('name'=>translate('MENU_LOGGANG_GANGGETEXP'), 'item' => $itemfour),
            				'gangrich' => array('name' => translate('MENU_LOGGANG_GANGRICH'), 'item' => $itemfour),//
            			),
            	),
            	//交易体系信息
            	'logtrade' => array
            	(
            		'name' => translate("MENU_LOGTRADE"),
            		'item' => array
            			(
            				'openglobinbox' => array('name' => translate('MENU_PLAYERLOG_OPENGLOBINBOX'), 'item' => $itemfour), 
            				'globinboxobject' => array('name' => translate('MENU_PLAYERLOG_GLOBINBOXOBJECT'), 'item' => $itemfour), 
            				'storeconsume' => array('name' => translate('MENU_LOGTRADE_STORECONSUME'), 'item' => $itemfour), 
            				'shopinformation' => array('name' => translate('MENU_PLAYERLOG_SHOPINFO'), 'item' => $itemfour),
            				//'npcsell' => array('name' => translate('MENU_LOGTRADE_NPCSELL'), 'item' => $itemfour),
            				//'npcrecycle' => array('name' => translate('MENU_LOGTRADE_NPCRECYCLE'), 'item' => $itemfour), 
            				//'scorestore' => array('name' => translate('MENU_LOGTRADE_SCORESTORE'), 'item' => $itemfour),
            				//'arenastore' => array('name' => translate('MENU_LOGTRADE_ARENASTORE'), 'item' => $itemfour), 
            				//'consignmentgoods' => array('name' => translate('MENU_LOGTRADE_CONSIGNMENTGOODS'), 'item' => $itemfour),
            				//'consignmentgoodssale' => array('name' => translate('MENU_LOGTRADE_CONSIGNMENTGOODSSALE'), 'item' => $itemfour), 
            				//'vipsalemachine' => array('name' => translate('MENU_LOGTRADE_VIPSALEMACHINE'), 'item' => $itemfour),
            				'storeorder' => array('name' => translate('MENU_LOGTRADE_STOREORDER'), 'item' => $itemfour),
            			),
            	),
            	//充值体系信息
            	'logrecharge' => array
            	(
            		'name' => translate("MENU_LOGRECHARGE"),
            		'item' => array
            			(
            				'recharge' => array('name' => translate('MENU_PLAYERLOG_RECHARGE'), 'item' => $itemfour), 
            				'rechargeorder' => array('name' => translate('MENU_PLAYERLOG_RECHARGEORDER'), 'item' => $itemfour), 
            			),
            	),
            	//邮件体系信息
            	'logmail' => array
            	(
            		'name' => translate("MENU_LOGMAIL"),
            		'item' => array
            			(
            				'mailreceive'=>array('name'=>translate('MENU_LOGMAIL_MAILRECEIVE'), 'item' => $itemfour),  
            				//'mailattachment'=>array('name'=>translate('MENU_LOGMAIL_MAILATTACHMENT'), 'item' => $itemfour),
            			),
            	),
            	
            	//老虎机体系信息
            	'logtiger' => array
            	(
            		'name' => translate("MENU_LOGTIGER"),
            		'item' => array
            			(
            				//'activeskill'=>array('name'=>translate('MENU_SKILLSYSTEM_ACTIVESKILL'), 'item' => $itemfour),
            				//'resetskill'=>array('name'=>translate('MENU_SKILLSYSTEM_RESETSKILL'), 'item' => $itemfour),
            				//'upgradegangskill'=>array('name'=>translate('MENU_SKILLSYSTEM_UPGRADEGANGSKILL'), 'item' => $itemfour),
            			),
            	),
            	//运营活动体系信息
            	'logactivity' => array
            	(
            		'name' => translate("MENU_LOGACTIVITY"),
            		'item' => array
            			(
            				'welfarereceive'=>array('name'=>translate('MENU_LOGACTIVITY_WELFARERECEIVE'), 'item' => $itemfour),
            				//'achievereceive'=>array('name'=>translate('MENU_LOGACTIVITY_ACHIEVERECEIVE'), 'item' => $itemfour),
            				//'activeexchange'=>array('name'=>translate('MENU_LOGACTIVITY_ACTIVEEXCHANGE'), 'item' => $itemfour),
            				'activefinish'=>array('name'=>translate('MENU_LOGACTIVITY_ACTIVEFINISH'), 'item' => $itemfour),
            			),
            	),
            	//其它体系信息
            	'logother' => array
            	(
            		'name' => translate("MENU_LOGOTEHR"),
            		'item' => array
            			(
            				//'wishing'=>array('name'=>translate('MENU_LOGOTEHR_WISHING'), 'item' => $itemfour),
            				//'wishingextendpool'=>array('name'=>translate('MENU_LOGOTEHR_WISHINGEXTENDPOOL'), 'item' => $itemfour),            				
            				//'wishingcollect'=>array('name'=>translate('MENU_LOGOTEHR_WISHINGCOLLECT'), 'item' => $itemfour),
            				//'wishingrefreshgold'=>array('name'=>translate('MENU_LOGOTEHR_WISHINGREFRESHGOLD'), 'item' => $itemfour),
            				//'wishingaccelerate'=>array('name'=>translate('MENU_LOGOTEHR_WISHINGACCELERATE'), 'item' => $itemfour),
            				//'typecardget'=>array('name'=>translate('MENU_LOGOTEHR_TYPE_CARDGET'), 'item' => $itemfour),
            				//'activatecode'=>array('name'=>translate('MENU_LOGOTEHR_ACTIVATECODE'), 'item' => $itemfour),
            				//'phonebinding'=>array('name'=>translate('MENU_LOGOTEHR_PHONEBINDING'), 'item' => $itemfour),
            				//'tiredrecord'=>array('name'=>translate('MENU_LOGOTEHR_TIREDRECORD'), 'item' => $itemfour),
            				'roleupgrade'=>array('name'=>translate('MENU_LOGOTEHR_ROLEUPGRADE'), 'item' => $itemfour),
            				'task'=>array('name'=>translate('MENU_LOGOTEHR_TASK'), 'item' => $itemfour),
            				'vip'=>array('name'=>translate('MENU_LOGOTEHR_VIP'), 'item' => $itemfour),            				
            				//'taskguide'=>array('name'=>translate('MENU_LOGOTEHR_TASKGUIDE'), 'item' => $itemfour),
            				//'newroleguide'=>array('name'=>translate('MENU_LOGOTEHR_NEWROLEGUIDE'), 'item' => $itemfour),	
            			),
            	),*/
        		//LOG角色相关
        		'log_role' => array
        		(
        				'name' => translate("MENU_ABOUT_ROLE"),
        				'item' => array
        				(
        						'accountcreate'=>array('name'=>translate('MENU_ABOUT_ROLE_ACOUNTCREATE'), 'item' => $itemfour),
        						'accountlogin'=>array('name'=>translate('MENU_ABOUT_ROLE_ACOUNTLOGIN'), 'item' => $itemfour),
        						'rolelogin'=>array('name'=>translate('MENU_ABOUT_ROLE_ROLELOGIN'), 'item' => $itemfour),
        						//'rolecreate'=>array('name'=>translate('MENU_ABOUT_ROLE_ROLECREATE'), 'item' => $itemfour),
//        						'exitgame'=>array('name'=>translate('MENU_ABOUT_ROLE_EXITGAME'), 'item' => $itemfour),
        						//'deviceactivation'=>array('name'=>translate('MENU_ABOUT_ROLE_DEVICEACTIVATION'), 'item' => $itemfour),
        				),
        		),

        		//LOG玩家战斗信息
        		'log_player' => array
        		(
        				'name' => translate("MENU_ABOUT_PLAYER"),
        				'item' => array
        				(
        						'rolefriend'=>array('name'=>translate('MENU_ABOUT_PLAYER_ROLEFRIEND'), 'item' => $itemfour),
        						'roleexp'=>array('name'=>translate('MENU_ABOUT_PLAYER_ROLEEXP'), 'item' => $itemfour),
        						'roleupgrade'=>array('name'=>translate('MENU_ABOUT_PLAYER_ROLEUPGRADE'), 'item' => $itemfour),
        						'equipupgrade'=>array('name'=>translate('MENU_ABOUT_PLAYER_EQUIPUPGRADE'), 'item' => $itemfour),
        						'equipforge'=>array('name'=>translate('MENU_ABOUT_PLAYER_EQUIPFORGE'), 'item' => $itemfour),
        						'rolecultivate'=>array('name'=>translate('MENU_ABOUT_PLAYER_ROLECULTIVATE'), 'item' => $itemfour),
        						'upgradeskill'=>array('name'=>translate('MENU_ABOUT_PLAYER_UPGRADESKILL'), 'item' => $itemfour),
//        						'gemupgrade'=>array('name'=>translate('MENU_ABOUT_PLAYER_GEMUPGRADE'), 'item' => $itemfour),
//        						'smeltequip'=>array('name'=>translate('MENU_ABOUT_PLAYER_SMELTEQUIP'), 'item' => $itemfour),
        				),
        		),
//        		//LOG玩家其他信息
//        		'log_playerother' => array
//        		(
//        				'name' => translate("MENU_ABOUT_PLAYEROHTER"),
//        				'item' => array
//        				(
//        						'robgood'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_ROBGOOD'), 'item' => $itemfour),
//        						'treasurecave'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_TREASURECAVE'), 'item' => $itemfour),
//        						'wanted'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_WANTED'), 'item' => $itemfour),
//        						'activereward'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_ACTIVEREWARD'), 'item' => $itemfour),
//        						'task'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_TASK'), 'item' => $itemfour),
//        						'mail'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_MAIL'), 'item' => $itemfour),
//        						'speech'=>array('name'=>translate('MENU_ABOUT_PLAYEROHTER_SPEECH'), 'item' => $itemfour),
//        				),
//        		),
//        		//LOG排行榜信息
//        		'log_rank' => array
//        		(
//        				'name' => translate("MENU_ABOUT_RANK"),
//        				'item' => array
//        				(
//        						'rolerankladder'=>array('name'=>translate('MENU_ABOUT_RANK_LADDER'), 'item' => $itemfour),
//        						'roleranklevel'=>array('name'=>translate('MENU_ABOUT_RANK_LEVEL'), 'item' => $itemfour),
//        						'rolerankfight'=>array('name'=>translate('MENU_ABOUT_RANK_FIGHT'), 'item' => $itemfour),
//        						'gangrank'=>array('name'=>translate('MENU_ABOUT_RANK_GANG'), 'item' => $itemfour),
//        				),
//        		),

//        		//LOG战斗信息
//        		'log_fight' => array
//        		(
//        				'name' => translate("MENU_ABOUT_FIGHT"),
//        				'item' => array
//        				(
//        						'arena'=>array('name'=>translate('MENU_ABOUT_FIGHT_ARENA'), 'item' => $itemfour),
//        						'copy'=>array('name'=>translate('MENU_ABOUT_FIGHT_COPY'), 'item' => $itemfour),
//        						'relicssecret'=>array('name'=>translate('MENU_ABOUT_FIGHT_RELICSSECRET'), 'item' => $itemfour),
//        						'activecopy'=>array('name'=>translate('MENU_ABOUT_FIGHT_ACTIVECOPY'), 'item' => $itemfour),
//        				),
//        		),
//        		//LOG公会信息
//        		'log_gang' => array
//        		(
//        				'name' => translate("MENU_ABOUT_GANG"),
//        				'item' => array
//        				(
//        						'gangcreate'=>array('name'=>translate('MENU_ABOUT_GANG_GANGCREATE'), 'item' => $itemfour),
//        						'gangdismiss'=>array('name'=>translate('MENU_ABOUT_GANG_GANGDISMISS'), 'item' => $itemfour),
//        						'gangbuild'=>array('name'=>translate('MENU_ABOUT_GANG_GANGBULID'), 'item' => $itemfour),
//        						'gangnotice'=>array('name'=>translate('MENU_ABOUT_GANG_GANGNOTICE'), 'item' => $itemfour),
//        						'gangmemberchange'=>array('name'=>translate('MENU_ABOUT_GANG_GANGMEMBERCHANGE'), 'item' => $itemfour),
//        						'gangboss'=>array('name'=>translate('MENU_ABOUT_GANG_GANGBOSS'), 'item' => $itemfour),
//        						'gangtask'=>array('name'=>translate('MENU_ABOUT_GANG_GANGTASK'), 'item' => $itemfour),
//        				),
//        		),
//        		//LOG充值交易信息
//        		'log_trade' => array
//        		(
//        				'name' => translate("MENU_ABOUT_TRADE"),
//        				'item' => array
//        				(
//        						'recharge'=>array('name'=>translate('MENU_ABOUT_TRADE_RECHARGE'), 'item' => $itemfour),
//        						'globinboxobject'=>array('name'=>translate('MENU_ABOUT_TRADE_GLOBINBOXOBJECT'), 'item' => $itemfour),
//        						'storeconsume'=>array('name'=>translate('MENU_ABOUT_TRADE_STORECONSUME'), 'item' => $itemfour),
//        						'arenastore'=>array('name'=>translate('MENU_ABOUT_TRADE_ARENASTORE'), 'item' => $itemfour),
//        				),
//        		),
        		//LOG宠物时装英雄信息
        		//'log_pet' => array
        		//(
        		//		'name' => translate("MENU_ABOUT_PET"),
        		//		'item' => array
        		//		(
        		//				'petequipupgrade'=>array('name'=>translate('MENU_ABOUT_PET_PETEQUIPUPGRADE'), 'item' => $itemfour),
        		//				'petexpedition'=>array('name'=>translate('MENU_ABOUT_PET_PETEXPEDITION'), 'item' => $itemfour),
        		//				'getpet'=>array('name'=>translate('MENU_ABOUT_PET_GETPET'), 'item' => $itemfour),
        		//				'petsoulstone'=>array('name'=>translate('MENU_ABOUT_PET_SOULSTONE'), 'item' => $itemfour),
        		//				'petstarupper'=>array('name'=>translate('MENU_ABOUT_PET_STARUPPER'), 'item' => $itemfour),
        		//		),
        		//),
        		//LOG坐骑信息
//        		'log_horse' =>array
//        		(
//        				'name' => translate('MENU_ABOUT_HORSE'),
//        				'item' => array
//        				(
//        						'horsecastingsoul' => array('name' => translate('MENU_ABOUT_HORSE_CASTSOUL'), 'item' => $itemfour),
//        						'horsegift' => array('name' => translate('MENU_ABOUT_HORSE_GIFT'), 'item' => $itemfour),
//        				),
//
//        		),
        		//LOG备份信息
        		'log_backup' => array
        		(
        				'name' => translate("MENU_ABOUT_BACKUP"),
        				'item' => array
        				(
        						'roleinfo'=>array('name'=>translate('MENU_ABOUT_BACKUP_ROLEINFO'), 'item' => $itemfour),
        						'equippackage'=>array('name'=>translate('MENU_ABOUT_BACKUP_EQUIPPACKAGE'), 'item' => $itemfour), 
        						'package'=>array('name'=>translate('MENU_ABOUT_BACKUP_PACKAGE'), 'item' => $itemfour),
        						'friendinfo'=>array('name'=>translate('MENU_ABOUT_BACKUP_FRIENDINFO'), 'item' => $itemfour),
        						'mailinfo'=>array('name'=>translate('MENU_ABOUT_BACKUP_MAILINFO'), 'item' => $itemfour),
        						'maintask'=>array('name'=>translate('MENU_ABOUT_BACKUP_MAINTASK'), 'item' => $itemfour),
        						'gang'=>array('name'=>translate('MENU_ABOUT_BACKUP_GANG'), 'item' => $itemfour),
        						'gangrole'=>array('name'=>translate('MENU_ABOUT_BACKUP_GANGROLE'), 'item' => $itemfour),
        				),
        		),
        );
        $this->view->assign("permission", $permissionarray);
        //左侧导航菜单列表数组生成
        $menuarray = array();
        foreach ($permissionarray as $m => $n) {
            $menuarray[$m] = $this->get_permission_item($m, $permissionarray, isset($n['append']) ? $n['append'] : array());
        }
        $this->view->assign("menu", $menuarray);
        //自动匹配标题
        $na = 'MENU' . str_replace('_INDEX', '', str_replace('/', '_', strtoupper(get_instance()->path_info)));
        //exit($na);
        if (isset($lang[$na])) {
            $this->view->assign("title", $lang[$na]);
        }
        $this->online();
    }

    function online() {
        $adminname = $this->auth->username;
        $filename = DATAPATH . 'chats/online.php';
        if (!file_exists($filename))
            file_put_contents($filename, '<?php exit;?>');
        $content = str_replace('<?php exit;?>', '', file_get_contents($filename));
        $onlines = json_decode($content, true);
        $result = $data = array();
        $isexist = false;
        $urls = parse_url($this->input->server('HTTP_REFERER'));
        $url = is_array($urls) && $urls['path'] != '' ? $urls['path'] : '';
        if (is_array($onlines)) {
            foreach ($onlines as $key => $value) {
                $value = (array) $value;
                if ($adminname != '' && $value['nickname'] == $adminname) {
                    $isexist = true;
                    $value['last_activity'] = date('Y-m-d H:i:s');
                    $value['url'] = $url;
                }
                if (strtotime($value['last_activity']) > (time() - 600))
                    $result[] = $value;
            }
        }
        if ($adminname != '' && !$isexist)
            $result[] = array('nickname' => $adminname, 'last_activity' => date('Y-m-d H:i:s'), 'url' => $url);

        $fp = fopen($filename, "w+");
        if (@flock($fp, LOCK_EX)) {
            @fputs($fp, '<?php exit;?>' . json_encode($result));
            @flock($fp, LOCK_UN);
        }
        @fclose($fp);

        //统计在线
        $online_cur_t = $online_list_t = array();
        foreach ($result as $key => $value) {
            $online_list_t[] = "<li><i>{$value['nickname']}</i><span>{$value['last_activity']}</span></li>";
            if ($url == $value['url'])
                $online_cur_t[] = "<a href='javascript:;' title=''>{$value['nickname']}</a>";
        }
        $data['online_total'] = count($result);
        $data['online_cur'] = implode('|', $online_cur_t);
        $data['online_list'] = implode('', $online_list_t);
        $data['online_cur_total'] = count($online_cur_t);
        $this->view->assign($data);
    }

    function get_permission_item($module, $data, $append = array()) {
        if (isset($data[$module])) {
            $item = array();
            $editarray = array('add', 'edit', 'del');
            foreach ($data[$module]['item'] as $m => $n) {
                if (in_array($m, $editarray) || (isset($n['hide']) && $n['hide']))
                    continue;
                if ($m == 'index') {
                    $n['name'] = $data[$module]['name'];
                }
                $one = array('text' => $n['name'], 'url' => "{$module}/{$m}");
                if (isset($n['target'])) {
                    $one['target'] = $n['target'];
                }
                $item[] = $one;
            }
            $data[$module]['item'] = array_merge($item, $append);
            return $data[$module];
        } else {
            return array();
        }
    }

    //此函数用于获取flexigrid的参数
    function get_flexigrid_params() {
        $sortname = isset($_POST["sortname"]) ? $this->input->post('sortname') : '';
        $sortorder = isset($_POST["sortorder"]) ? $this->input->post("sortorder") : '';
        $page = isset($_POST["page"]) ? (int) $this->input->post("page") : 1;
        $rp = isset($_POST["rp"]) ? (int) $this->input->post("rp") : 20;
        $query = isset($_POST["query"]) ? $this->input->post("query") : '';
        $qtype = isset($_POST["qtype"]) ? $this->input->post('qtype') : '';
        $qop = isset($_POST["qop"]) ? $this->input->post('qop') : '';
        $colkey = isset($_POST["colkey"]) ? $this->input->post("colkey") : '';
        $searchitems = isset($_POST["searchitems"]) ? $this->input->post('searchitems') : array();
        $colsinfo = isset($_POST["colsinfo"]) ? $this->input->post("colsinfo") : '';
        $aliasinfo = isset($_POST["aliasinfo"]) ? $this->input->post("aliasinfo") : '';
        $colsarr = explode(',', $colsinfo);
        $aliasarr = explode(',', $aliasinfo);
        if (!$colsarr)
            error(translate('C_INVALID_PARAMS'));
        $page = $page > 0 ? $page : 1;
        $rp = $rp > 0 ? $rp : 20;
        $offset = ($page - 1) * $rp;
        $sortname = $sortname ? $sortname : $colkey;
        $sortorder = strtoupper($sortorder);
        $sortorder = in_array($sortorder, array('ASC', 'DESC')) ? $sortorder : '';
        $qop = strtoupper($qop);
        $qop = in_array($qop, array('=', 'LIKE', '>', '<', '>=', '<=')) ? $qop : 'LIKE';
        $field = $where = array();
        //给字段加上``符号和别名
        foreach ($colsarr as $m => $n) {
            $pos = stripos($n, ".");
            $pre = substr($n, 0, $pos);
            $sub = substr($n, $pos + 1);
            $tempfield = $pos !== FALSE ? "{$pre}.`{$sub}`" : "`{$n}`";
            if (isset($aliasarr[$m]) && $aliasarr[$m] != $n) {
                $tempfield .= " AS `{$aliasarr[$m]}`";
            }
            $field[] = $tempfield;
        }
        $colsinfo = implode(",", $field);
        //严格模式则加上： && in_array($qtype, $colsarr)
        if ($qtype && $qop && $query != '') {
            $query = $query == 'null' ? '' : $query;
            $mark = $qop == 'LIKE' ? '%' : '';
            $pos = stripos($qtype, ".");
            $qtype = $pos !== FALSE ? substr($qtype, 0, $pos + 1) . "`" . substr($qtype, $pos + 1) . "`" : "`{$qtype}`";
            $where[] = "{$qtype} {$qop} '{$mark}{$query}{$mark}'";
        }
        //循环搜索的条目
        foreach ($searchitems as $m => $n) {
            $sarray = explode('$$', $n);
            if (!isset($sarray[0]))
                continue;
            $field = $sarray[0];
            $pos = stripos($field, ".");
            $sval = isset($sarray[2]) ? $sarray[2] : '';
            $sval = strtolower($sval) == 'null' ? '' : $sval;
            $sop = strtoupper(isset($sarray[1]) ? $sarray[1] : '=');
            $mark = $sop == 'LIKE' ? '%' : '';
            $sfield = $pos !== FALSE ? substr($field, 0, $pos + 1) . "`" . substr($field, $pos + 1) . "`" : "`{$field}`";
            $where[] = "{$sfield} {$sop} '{$mark}{$sval}{$mark}'";
        }
        $where = implode(" AND ", $where);
        $where = $where ? $where : '1=1';
        return array($colkey, $colsinfo, $where, $sortname, $sortorder, $offset, $rp, $page);
    }

}
